<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>招商加盟 - 商机列表</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #2c6ecb;
            --primary-light: #4a89dc;
            --secondary: #f6bb42;
            --success: #37bc9b;
            --danger: #da4453;
            --text-primary: #333333;
            --text-secondary: #656d78;
            --text-tertiary: #aab2bd;
            --bg-light: #f5f7fa;
            --bg-white: #ffffff;
            --border-light: #e6e9ed;
            --radius: 8px;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 60px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--primary);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        .nav-title {
            font-size: 18px;
            font-weight: 600;
            color: white;
            text-align: center;
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        
        .nav-btn {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: none;
            border: none;
            color: white;
            font-size: 20px;
        }
        
        /* 搜索栏 */
        .search-container {
            background-color: var(--bg-white);
            padding: 12px 16px;
            position: sticky;
            top: 56px;
            z-index: 900;
            border-bottom: 1px solid var(--border-light);
        }
        
        .search-box {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border-radius: 20px;
            border: 1px solid var(--border-light);
            background-color: var(--bg-light);
            font-size: 14px;
        }
        
        .search-input:focus {
            outline: none;
            border-color: var(--primary);
            background-color: white;
        }
        
        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-tertiary);
        }
        
        /* 筛选栏 */
        .filter-bar {
            background-color: var(--bg-white);
            padding: 0 16px;
            display: flex;
            overflow-x: auto;
            white-space: nowrap;
            border-bottom: 1px solid var(--border-light);
        }
        
        .filter-item {
            padding: 12px 16px;
            font-size: 14px;
            color: var(--text-secondary);
            border: none;
            background: none;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .filter-item.active {
            color: var(--primary);
            font-weight: 500;
            position: relative;
        }
        
        .filter-item.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 2px;
            background-color: var(--primary);
        }
        
        .filter-icon {
            font-size: 16px;
        }
        
        /* 招商加盟列表 */
        .franchise-list {
            padding: 10px 16px;
        }
        
        .franchise-item {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            overflow: hidden;
            margin-bottom: 12px;
            box-shadow: var(--shadow);
            transition: transform 0.2s ease;
        }
        
        .franchise-item:hover {
            transform: translateY(-2px);
        }
        
        .franchise-link {
            text-decoration: none;
            color: var(--text-primary);
            display: block;
        }
        
        /* 无图样式 */
        .franchise-no-image {
            padding: 16px;
        }
        
        /* 单图样式 */
        .franchise-single-image {
            display: flex;
            gap: 12px;
        }
        
        .single-image-container {
            width: 100px;
            height: 100px;
            flex-shrink: 0;
            overflow: hidden;
        }
        
        .single-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .single-image-content {
            padding: 16px 16px 16px 0;
            flex: 1;
        }
        
        /* 多图样式 */
        .franchise-multi-image {
            padding: 16px;
        }
        
        .multi-images-container {
            display: flex;
            gap: 6px;
            margin-top: 10px;
        }
        
        .multi-image {
            width: 32%;
            height: 80px;
            border-radius: 4px;
            object-fit: cover;
        }
        
        /* 内容通用样式 */
        .franchise-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 6px;
            line-height: 1.3;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        
        .franchise-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 8px;
        }
        
        .meta-item {
            font-size: 12px;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .meta-icon {
            font-size: 12px;
        }
        
        .franchise-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        
        .franchise-tag {
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 12px;
            background-color: rgba(44, 110, 203, 0.1);
            color: var(--primary);
        }
        
        .tag-investment {
            background-color: rgba(246, 187, 66, 0.1);
            color: #d87c28;
        }
        
        .tag-hot {
            background-color: rgba(218, 68, 83, 0.1);
            color: var(--danger);
        }
        
        /* 底部操作栏 */
        .franchise-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 16px;
            border-top: 1px solid var(--border-light);
            margin-top: 8px;
        }
        
        .action-stats {
            display: flex;
            gap: 16px;
        }
        
        .stat-item {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 12px;
            color: var(--text-secondary);
        }
        
        .contact-btn {
            padding: 4px 12px;
            border-radius: 14px;
            background-color: var(--primary);
            color: white;
            border: none;
            font-size: 13px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        /* 加载更多 */
        .load-more {
            padding: 20px 16px;
            text-align: center;
        }
        
        .load-more-btn {
            padding: 8px 24px;
            border-radius: 20px;
            background-color: var(--bg-white);
            border: 1px solid var(--border-light);
            color: var(--text-secondary);
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin: 0 auto;
        }
        
        .load-more-btn.loading {
            color: var(--text-tertiary);
        }
        
        .load-more-btn.loading i {
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-tertiary);
            font-size: 11px;
            gap: 4px;
            text-decoration: none;
            flex: 1;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        .nav-icon {
            font-size: 20px;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            z-index: 9999;
            font-size: 14px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
        
        /* 图片查看器 */
        .image-viewer {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: black;
            z-index: 2000;
            display: none;
            justify-content: center;
            align-items: center;
        }
        
        .image-viewer.active {
            display: flex;
        }
        
        .viewer-image {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }
        
        .close-viewer {
            position: absolute;
            top: 16px;
            right: 16px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
        }
        
        .viewer-count {
            position: absolute;
            top: 16px;
            left: 16px;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            font-size: 14px;
            padding: 4px 10px;
            border-radius: 12px;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">招商加盟</div>
        <button class="nav-btn" id="publishBtn">
            <i class="fas fa-plus"></i>
        </button>
    </div>
    
    <!-- 搜索栏 -->
    <div class="search-container">
        <div class="search-box">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索招商项目、品牌、行业...">
        </div>
    </div>
    
    <!-- 筛选栏 -->
    <div class="filter-bar">
        <button class="filter-item active">
            <span>全部</span>
        </button>
        <button class="filter-item">
            <span>餐饮美食</span>
        </button>
        <button class="filter-item">
            <span>教育培训</span>
        </button>
        <button class="filter-item">
            <span>休闲娱乐</span>
        </button>
        <button class="filter-item">
            <span>零售超市</span>
        </button>
        <button class="filter-item">
            <span>美容养生</span>
        </button>
        <button class="filter-item">
            <i class="fas fa-sliders-h filter-icon"></i>
            <span>筛选</span>
        </button>
    </div>
    
    <!-- 招商加盟列表 -->
    <div class="franchise-list">
        <!-- 无图样式 -->
        <div class="franchise-item">
            <a href="#" class="franchise-link">
                <div class="franchise-no-image">
                    <h3 class="franchise-title">2023年热门教育品牌招商，全程扶持，低门槛创业</h3>
                    
                    <div class="franchise-meta">
                        <div class="meta-item">
                            <i class="fas fa-building meta-icon"></i>
                            <span>智慧教育集团</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-map-marker-alt meta-icon"></i>
                            <span>全国招商</span>
                        </div>
                        <div class="meta-item">
                            <i class="far fa-clock meta-icon"></i>
                            <span>2小时前更新</span>
                        </div>
                    </div>
                    
                    <div class="franchise-tags">
                        <span class="franchise-tag">教育培训</span>
                        <span class="franchise-tag tag-investment">5-10万</span>
                        <span class="franchise-tag tag-hot">热门项目</span>
                    </div>
                </div>
                
                <div class="franchise-actions">
                    <div class="action-stats">
                        <div class="stat-item">
                            <i class="far fa-eye"></i>
                            <span>2.5k</span>
                        </div>
                        <div class="stat-item">
                            <i class="far fa-comment"></i>
                            <span>128</span>
                        </div>
                        <div class="stat-item">
                            <i class="far fa-heart"></i>
                            <span>356</span>
                        </div>
                    </div>
                    <button class="contact-btn">
                        <i class="fas fa-phone"></i>
                        <span>咨询</span>
                    </button>
                </div>
            </a>
        </div>
        
        <!-- 单图样式 -->
        <div class="franchise-item">
            <a href="#" class="franchise-link">
                <div class="franchise-single-image">
                    <div class="single-image-container">
                        <img src="https://picsum.photos/id/292/300/300" alt="咖啡品牌加盟" class="single-image">
                    </div>
                    <div class="single-image-content">
                        <h3 class="franchise-title">精品咖啡品牌诚招加盟商，提供全套运营支持和培训</h3>
                        
                        <div class="franchise-meta">
                            <div class="meta-item">
                                <i class="fas fa-building meta-icon"></i>
                                <span>醇香咖啡有限公司</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-map-marker-alt meta-icon"></i>
                                <span>一线城市</span>
                            </div>
                            <div class="meta-item">
                                <i class="far fa-clock meta-icon"></i>
                                <span>5小时前更新</span>
                            </div>
                        </div>
                        
                        <div class="franchise-tags">
                            <span class="franchise-tag">餐饮美食</span>
                            <span class="franchise-tag tag-investment">20-50万</span>
                            <span class="franchise-tag">全程扶持</span>
                        </div>
                    </div>
                </div>
                
                <div class="franchise-actions">
                    <div class="action-stats">
                        <div class="stat-item">
                            <i class="far fa-eye"></i>
                            <span>1.8k</span>
                        </div>
                        <div class="stat-item">
                            <i class="far fa-comment"></i>
                            <span>96</span>
                        </div>
                        <div class="stat-item">
                            <i class="far fa-heart"></i>
                            <span>215</span>
                        </div>
                    </div>
                    <button class="contact-btn">
                        <i class="fas fa-phone"></i>
                        <span>咨询</span>
                    </button>
                </div>
            </a>
        </div>
        
        <!-- 多图样式 -->
        <div class="franchise-item">
            <a href="#" class="franchise-link">
                <div class="franchise-multi-image">
                    <h3 class="franchise-title">连锁便利店品牌招商，成熟运营模式，总部全程支持开店</h3>
                    
                    <div class="franchise-meta">
                        <div class="meta-item">
                            <i class="fas fa-building meta-icon"></i>
                            <span>惠民连锁有限公司</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-map-marker-alt meta-icon"></i>
                            <span>全国范围</span>
                        </div>
                        <div class="meta-item">
                            <i class="far fa-clock meta-icon"></i>
                            <span>昨天 14:30</span>
                        </div>
                    </div>
                    
                    <div class="franchise-tags">
                        <span class="franchise-tag">零售超市</span>
                        <span class="franchise-tag tag-investment">50-100万</span>
                        <span class="franchise-tag">品牌保障</span>
                    </div>
                    
                    <div class="multi-images-container" data-images='["https://picsum.photos/id/42/300/300", "https://picsum.photos/id/43/300/300", "https://picsum.photos/id/44/300/300"]'>
                        <img src="https://picsum.photos/id/42/300/300" alt="便利店环境" class="multi-image">
                        <img src="https://picsum.photos/id/43/300/300" alt="商品陈列" class="multi-image">
                        <img src="https://picsum.photos/id/44/300/300" alt="门店外观" class="multi-image">
                    </div>
                </div>
                
                <div class="franchise-actions">
                    <div class="action-stats">
                        <div class="stat-item">
                            <i class="far fa-eye"></i>
                            <span>3.2k</span>
                        </div>
                        <div class="stat-item">
                            <i class="far fa-comment"></i>
                            <span>156</span>
                        </div>
                        <div class="stat-item">
                            <i class="far fa-heart"></i>
                            <span>428</span>
                        </div>
                    </div>
                    <button class="contact-btn">
                        <i class="fas fa-phone"></i>
                        <span>咨询</span>
                    </button>
                </div>
            </a>
        </div>
        
        <!-- 无图样式 -->
        <div class="franchise-item">
            <a href="#" class="franchise-link">
                <div class="franchise-no-image">
                    <h3 class="franchise-title">健康养生品牌招商加盟，市场需求大，利润空间高，全程指导</h3>
                    
                    <div class="franchise-meta">
                        <div class="meta-item">
                            <i class="fas fa-building meta-icon"></i>
                            <span>康体养生集团</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-map-marker-alt meta-icon"></i>
                            <span>一二线城市</span>
                        </div>
                        <div class="meta-item">
                            <i class="far fa-clock meta-icon"></i>
                            <span>2天前更新</span>
                        </div>
                    </div>
                    
                    <div class="franchise-tags">
                        <span class="franchise-tag">美容养生</span>
                        <span class="franchise-tag tag-investment">100-200万</span>
                        <span class="franchise-tag">整店输出</span>
                    </div>
                </div>
                
                <div class="franchise-actions">
                    <div class="action-stats">
                        <div class="stat-item">
                            <i class="far fa-eye"></i>
                            <span>986</span>
                        </div>
                        <div class="stat-item">
                            <i class="far fa-comment"></i>
                            <span>76</span>
                        </div>
                        <div class="stat-item">
                            <i class="far fa-heart"></i>
                            <span>156</span>
                        </div>
                    </div>
                    <button class="contact-btn">
                        <i class="fas fa-phone"></i>
                        <span>咨询</span>
                    </button>
                </div>
            </a>
        </div>
        
        <!-- 多图样式 -->
        <div class="franchise-item">
            <a href="#" class="franchise-link">
                <div class="franchise-multi-image">
                    <h3 class="franchise-title">儿童乐园连锁品牌招商，市场潜力大，总部提供全方位支持</h3>
                    
                    <div class="franchise-meta">
                        <div class="meta-item">
                            <i class="fas fa-building meta-icon"></i>
                            <span>童趣游乐有限公司</span>
                        </div>
                        <div class="meta-item">
                            <i class="fas fa-map-marker-alt meta-icon"></i>
                            <span>全国招商</span>
                        </div>
                        <div class="meta-item">
                            <i class="far fa-clock meta-icon"></i>
                            <span>3天前更新</span>
                        </div>
                    </div>
                    
                    <div class="franchise-tags">
                        <span class="franchise-tag">休闲娱乐</span>
                        <span class="franchise-tag tag-investment">80-150万</span>
                        <span class="franchise-tag tag-hot">热门项目</span>
                    </div>
                    
                    <div class="multi-images-container" data-images='["https://picsum.photos/id/106/300/300", "https://picsum.photos/id/107/300/300", "https://picsum.photos/id/108/300/300"]'>
                        <img src="https://picsum.photos/id/106/300/300" alt="乐园环境" class="multi-image">
                        <img src="https://picsum.photos/id/107/300/300" alt="游乐设施" class="multi-image">
                        <img src="https://picsum.photos/id/108/300/300" alt="活动现场" class="multi-image">
                    </div>
                </div>
                
                <div class="franchise-actions">
                    <div class="action-stats">
                        <div class="stat-item">
                            <i class="far fa-eye"></i>
                            <span>2.1k</span>
                        </div>
                        <div class="stat-item">
                            <i class="far fa-comment"></i>
                            <span>103</span>
                        </div>
                        <div class="stat-item">
                            <i class="far fa-heart"></i>
                            <span>289</span>
                        </div>
                    </div>
                    <button class="contact-btn">
                        <i class="fas fa-phone"></i>
                        <span>咨询</span>
                    </button>
                </div>
            </a>
        </div>
    </div>
    
    <!-- 加载更多 -->
    <div class="load-more">
        <button class="load-more-btn" id="loadMoreBtn">
            <span>加载更多</span>
            <i class="fas fa-chevron-down"></i>
        </button>
    </div>
    
    <!-- 图片查看器 -->
    <div class="image-viewer" id="imageViewer">
        <button class="close-viewer" id="closeViewer">
            <i class="fas fa-times"></i>
        </button>
        <div class="viewer-count" id="viewerCount">1/3</div>
        <img src="" alt="图片查看" class="viewer-image" id="viewerImage">
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home nav-icon"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-handshake nav-icon"></i>
            <span>招商</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-bell nav-icon"></i>
            <span>消息</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user nav-icon"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 提示消息 -->
    <div class="toast" id="toast"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const publishBtn = document.getElementById('publishBtn');
        const loadMoreBtn = document.getElementById('loadMoreBtn');
        const filterItems = document.querySelectorAll('.filter-item');
        const contactBtns = document.querySelectorAll('.contact-btn');
        const imageViewer = document.getElementById('imageViewer');
        const viewerImage = document.getElementById('viewerImage');
        const viewerCount = document.getElementById('viewerCount');
        const closeViewer = document.getElementById('closeViewer');
        const toast = document.getElementById('toast');
        const multiImageContainers = document.querySelectorAll('.multi-images-container');
        
        // 图片查看器相关变量
        let currentImages = [];
        let currentImageIndex = 0;
        
        // 返回按钮
        backBtn.addEventListener('click', () => {
            history.back();
        });
        
        // 发布按钮
        publishBtn.addEventListener('click', () => {
            showToast('发布招商信息功能待开发');
        });
        
        // 筛选按钮
        filterItems.forEach(item => {
            item.addEventListener('click', () => {
                // 移除所有激活状态
                filterItems.forEach(i => i.classList.remove('active'));
                // 添加当前激活状态
                item.classList.add('active');
                showToast(`已切换至${item.querySelector('span').textContent}`);
            });
        });
        
        // 联系按钮
        contactBtns.forEach(btn => {
            btn.addEventListener('click', (e) => {
                e.preventDefault();
                e.stopPropagation();
                const title = btn.closest('.franchise-item').querySelector('.franchise-title').textContent;
                showToast(`正在联系【${title.substring(0, 10)}...】`);
            });
        });
        
        // 图片查看器
        multiImageContainers.forEach(container => {
            container.addEventListener('click', (e) => {
                e.preventDefault();
                // 获取点击的图片索引
                const images = container.querySelectorAll('.multi-image');
                const clickedImage = e.target.closest('.multi-image');
                
                if (clickedImage) {
                    // 获取图片数组
                    currentImages = JSON.parse(container.getAttribute('data-images'));
                    // 获取当前点击的图片索引
                    currentImageIndex = Array.from(images).indexOf(clickedImage);
                    // 打开图片查看器
                    openImageViewer();
                }
            });
        });
        
        // 打开图片查看器
        function openImageViewer() {
            viewerImage.src = currentImages[currentImageIndex];
            viewerCount.textContent = `${currentImageIndex + 1}/${currentImages.length}`;
            imageViewer.classList.add('active');
            document.body.style.overflow = 'hidden';
        }
        
        // 关闭图片查看器
        closeViewer.addEventListener('click', () => {
            imageViewer.classList.remove('active');
            document.body.style.overflow = 'auto';
        });
        
        // 图片查看器左右滑动切换图片
        let startX = 0;
        imageViewer.addEventListener('touchstart', (e) => {
            startX = e.touches[0].clientX;
        });
        
        imageViewer.addEventListener('touchend', (e) => {
            const endX = e.changedTouches[0].clientX;
            const diffX = endX - startX;
            
            // 滑动距离足够大才切换图片
            if (Math.abs(diffX) > 50) {
                if (diffX > 0) {
                    // 向右滑动，查看上一张
                    currentImageIndex = (currentImageIndex - 1 + currentImages.length) % currentImages.length;
                } else {
                    // 向左滑动，查看下一张
                    currentImageIndex = (currentImageIndex + 1) % currentImages.length;
                }
                viewerImage.src = currentImages[currentImageIndex];
                viewerCount.textContent = `${currentImageIndex + 1}/${currentImages.length}`;
            }
        });
        
        // 加载更多
        loadMoreBtn.addEventListener('click', function() {
            this.innerHTML = '<span>加载中</span><i class="fas fa-spinner"></i>';
            this.classList.add('loading');
            
            // 模拟加载延迟
            setTimeout(() => {
                const franchiseList = document.querySelector('.franchise-list');
                
                // 随机添加3个不同样式的招商项目
                for (let i = 0; i < 3; i++) {
                    const randomType = Math.floor(Math.random() * 3); // 0:无图, 1:单图, 2:多图
                    const randomId = 200 + i;
                    const industries = ['餐饮美食', '教育培训', '休闲娱乐', '零售超市', '美容养生'];
                    const industry = industries[Math.floor(Math.random() * industries.length)];
                    const investments = ['5-10万', '10-20万', '20-50万', '50-100万', '100-200万'];
                    const investment = investments[Math.floor(Math.random() * investments.length)];
                    const isHot = Math.random() > 0.7;
                    
                    let itemHtml = '';
                    
                    if (randomType === 0) {
                        // 无图样式
                        itemHtml = `
                            <div class="franchise-item">
                                <a href="#" class="franchise-link">
                                    <div class="franchise-no-image">
                                        <h3 class="franchise-title">优质${industry}品牌招商，总部全程扶持，创业无忧${i+1}</h3>
                                        
                                        <div class="franchise-meta">
                                            <div class="meta-item">
                                                <i class="fas fa-building meta-icon"></i>
                                                <span>诚信招商企业${i+1}</span>
                                            </div>
                                            <div class="meta-item">
                                                <i class="fas fa-map-marker-alt meta-icon"></i>
                                                <span>全国招商</span>
                                            </div>
                                            <div class="meta-item">
                                                <i class="far fa-clock meta-icon"></i>
                                                <span>${i+3}天前更新</span>
                                            </div>
                                        </div>
                                        
                                        <div class="franchise-tags">
                                            <span class="franchise-tag">${industry}</span>
                                            <span class="franchise-tag tag-investment">${investment}</span>
                                            ${isHot ? '<span class="franchise-tag tag-hot">热门项目</span>' : ''}
                                        </div>
                                    </div>
                                    
                                    <div class="franchise-actions">
                                        <div class="action-stats">
                                            <div class="stat-item">
                                                <i class="far fa-eye"></i>
                                                <span>${Math.floor(Math.random() * 2000) + 500}</span>
                                            </div>
                                            <div class="stat-item">
                                                <i class="far fa-comment"></i>
                                                <span>${Math.floor(Math.random() * 100) + 30}</span>
                                            </div>
                                            <div class="stat-item">
                                                <i class="far fa-heart"></i>
                                                <span>${Math.floor(Math.random() * 300) + 80}</span>
                                            </div>
                                        </div>
                                        <button class="contact-btn">
                                            <i class="fas fa-phone"></i>
                                            <span>咨询</span>
                                        </button>
                                    </div>
                                </a>
                            </div>
                        `;
                    } else if (randomType === 1) {
                        // 单图样式
                        itemHtml = `
                            <div class="franchise-item">
                                <a href="#" class="franchise-link">
                                    <div class="franchise-single-image">
                                        <div class="single-image-container">
                                            <img src="https://picsum.photos/id/${randomId}/300/300" alt="${industry}加盟" class="single-image">
                                        </div>
                                        <div class="single-image-content">
                                            <h3 class="franchise-title">${industry}连锁品牌招商，低投入高回报，诚邀加盟${i+1}</h3>
                                            
                                            <div class="franchise-meta">
                                                <div class="meta-item">
                                                    <i class="fas fa-building meta-icon"></i>
                                                    <span>知名品牌企业${i+1}</span>
                                                </div>
                                                <div class="meta-item">
                                                    <i class="fas fa-map-marker-alt meta-icon"></i>
                                                    <span>全国范围</span>
                                                </div>
                                                <div class="meta-item">
                                                    <i class="far fa-clock meta-icon"></i>
                                                    <span>${i+4}天前更新</span>
                                                </div>
                                            </div>
                                            
                                            <div class="franchise-tags">
                                                <span class="franchise-tag">${industry}</span>
                                                <span class="franchise-tag tag-investment">${investment}</span>
                                                <span class="franchise-tag">全程扶持</span>
                                            </div>
                                        </div>
                                    </div>
                                    
                                    <div class="franchise-actions">
                                        <div class="action-stats">
                                            <div class="stat-item">
                                                <i class="far fa-eye"></i>
                                                <span>${Math.floor(Math.random() * 2000) + 500}</span>
                                            </div>
                                            <div class="stat-item">
                                                <i class="far fa-comment"></i>
                                                <span>${Math.floor(Math.random() * 100) + 30}</span>
                                            </div>
                                            <div class="stat-item">
                                                <i class="far fa-heart"></i>
                                                <span>${Math.floor(Math.random() * 300) + 80}</span>
                                            </div>
                                        </div>
                                        <button class="contact-btn">
                                            <i class="fas fa-phone"></i>
                                            <span>咨询</span>
                                        </button>
                                    </div>
                                </a>
                            </div>
                        `;
                    } else {
                        // 多图样式
                        const imgIds = [randomId, randomId+1, randomId+2];
                        itemHtml = `
                            <div class="franchise-item">
                                <a href="#" class="franchise-link">
                                    <div class="franchise-multi-image">
                                        <h3 class="franchise-title">${industry}优质品牌招商，成熟运营体系，加盟即盈利${i+1}</h3>
                                        
                                        <div class="franchise-meta">
                                            <div class="meta-item">
                                                <i class="fas fa-building meta-icon"></i>
                                                <span>行业领先企业${i+1}</span>
                                            </div>
                                            <div class="meta-item">
                                                <i class="fas fa-map-marker-alt meta-icon"></i>
                                                <span>全国招商</span>
                                            </div>
                                            <div class="meta-item">
                                                <i class="far fa-clock meta-icon"></i>
                                                <span>${i+5}天前更新</span>
                                            </div>
                                        </div>
                                        
                                        <div class="franchise-tags">
                                            <span class="franchise-tag">${industry}</span>
                                            <span class="franchise-tag tag-investment">${investment}</span>
                                            ${isHot ? '<span class="franchise-tag tag-hot">热门项目</span>' : ''}
                                        </div>
                                        
                                        <div class="multi-images-container" data-images='["https://picsum.photos/id/${imgIds[0]}/300/300", "https://picsum.photos/id/${imgIds[1]}/300/300", "https://picsum.photos/id/${imgIds[2]}/300/300"]'>
                                            <img src="https://picsum.photos/id/${imgIds[0]}/300/300" alt="项目图片1" class="multi-image">
                                            <img src="https://picsum.photos/id/${imgIds[1]}/300/300" alt="项目图片2" class="multi-image">
                                            <img src="https://picsum.photos/id/${imgIds[2]}/300/300" alt="项目图片3" class="multi-image">
                                        </div>
                                    </div>
                                    
                                    <div class="franchise-actions">
                                        <div class="action-stats">
                                            <div class="stat-item">
                                                <i class="far fa-eye"></i>
                                                <span>${Math.floor(Math.random() * 2000) + 500}</span>
                                            </div>
                                            <div class="stat-item">
                                                <i class="far fa-comment"></i>
                                                <span>${Math.floor(Math.random() * 100) + 30}</span>
                                            </div>
                                            <div class="stat-item">
                                                <i class="far fa-heart"></i>
                                                <span>${Math.floor(Math.random() * 300) + 80}</span>
                                            </div>
                                        </div>
                                        <button class="contact-btn">
                                            <i class="fas fa-phone"></i>
                                            <span>咨询</span>
                                        </button>
                                    </div>
                                </a>
                            </div>
                        `;
                    }
                    
                    franchiseList.insertAdjacentHTML('beforeend', itemHtml);
                }
                
                // 重新绑定新添加的联系按钮事件
                const newContactBtns = document.querySelectorAll('.contact-btn:not([data-bound="true"])');
                newContactBtns.forEach(btn => {
                    btn.setAttribute('data-bound', 'true');
                    btn.addEventListener('click', (e) => {
                        e.preventDefault();
                        e.stopPropagation();
                        const title = btn.closest('.franchise-item').querySelector('.franchise-title').textContent;
                        showToast(`正在联系【${title.substring(0, 10)}...】`);
                    });
                });
                
                // 重新绑定新添加的图片容器事件
                const newImageContainers = document.querySelectorAll('.multi-images-container:not([data-bound="true"])');
                newImageContainers.forEach(container => {
                    container.setAttribute('data-bound', 'true');
                    container.addEventListener('click', (e) => {
                        e.preventDefault();
                        const images = container.querySelectorAll('.multi-image');
                        const clickedImage = e.target.closest('.multi-image');
                        
                        if (clickedImage) {
                            currentImages = JSON.parse(container.getAttribute('data-images'));
                            currentImageIndex = Array.from(images).indexOf(clickedImage);
                            openImageViewer();
                        }
                    });
                });
                
                // 恢复按钮状态
                this.innerHTML = '<span>加载更多</span><i class="fas fa-chevron-down"></i>';
                this.classList.remove('loading');
                
                showToast('已加载更多招商项目');
            }, 1500);
        });
        
        // 提示消息功能
        function showToast(message) {
            toast.textContent = message;
            toast.classList.add('show');
            
            setTimeout(() => {
                toast.classList.remove('show');
            }, 2000);
        }
        
        // 为所有招商项目添加点击事件，跳转到详情页
        document.addEventListener('click', (e) => {
            const franchiseLink = e.target.closest('.franchise-link');
            if (franchiseLink && !e.target.closest('.contact-btn') && !e.target.closest('.multi-image')) {
                const title = franchiseLink.querySelector('.franchise-title').textContent;
                showToast(`查看【${title.substring(0, 10)}...】详情`);
                // 实际应用中这里应该跳转到详情页
                // e.preventDefault();
            }
        });
    </script>
</body>
</html>

